package cn.com.roy.thread.t4_1_8.conditiontestmanytomany;


public class Run {
    public static void main(String[] args) {
        try {
            MyService service = new MyService();
//            ThreadA a = new ThreadA(service);
//            ThreadB b = new ThreadB(service);
//            a.setName("A");
//            a.start();
//            b.setName("B");
//            b.start();
            ThreadA[] a = new ThreadA[10];
            ThreadB[] b = new ThreadB[10];
            for (int i = 0; i < 10; i++) {
                  a[i] = new ThreadA(service);
                  b[i] = new ThreadB(service);
                  a[i].start();
                  b[i].start();
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
